Harden SecurePasswords assignment input/output handling and remove per-request Zxcvbn initialization#13
Draft
Giuseppe Guerra (GGuerraReply) with Copilot wants to merge 2 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/Cluster-Mesh/WebGoat/sessions/26e5a9a1-fcde-49ed-81ce-73ba5f49f1ab Co-authored-by: GGuerraReply <133228566+GGuerraReply@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add input validation for password parameter
Harden SecurePasswords assignment input/output handling and remove per-request Zxcvbn initialization
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses four issues in
SecurePasswordsAssignment: missing password input validation, repeatedZxcvbnconstruction per request, unescaped dynamic HTML output, and a misleading modulo expression incalculateTime.Input validation
passwordat the start ofcompleted(...).AttackResultwithsecurepassword-failedfeedback and a clear error message when input is empty.Zxcvbn lifecycle
new Zxcvbn()with a class-levelprivate static final Zxcvbn ZXCVBN.Output encoding / XSS hardening
HtmlUtilsand escaped dynamic values before appending to HTML output:Time calculation clarity
long sec = (seconds % min * s);tolong sec = seconds % min;to remove precedence ambiguity and dead multiply-by-1 logic.Focused regression coverage
SecurePasswordsAssignmentTestfor:calculateTime(61)expected remainder formattingWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkstyle.org/opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/xml/tools/xml-extractor.jar --fileList=/tmp/codeql-scratch-dbf01dac03ae7d91/dbs/java/working/files-to-index2027385754433674253.list --sourceArchiveDir=/tmp/codeql-scratch-dbf01dac03ae7d91/dbs/java/src --outputDir=/tmp/codeql-scratch-dbf01dac03ae7d91/dbs/java/trap/java(dns block)checkstyle.sourceforge.net/opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/xml/tools/xml-extractor.jar --fileList=/tmp/codeql-scratch-dbf01dac03ae7d91/dbs/java/working/files-to-index2027385754433674253.list --sourceArchiveDir=/tmp/codeql-scratch-dbf01dac03ae7d91/dbs/java/src --outputDir=/tmp/codeql-scratch-dbf01dac03ae7d91/dbs/java/trap/java(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt